import Vue from 'vue'
import VueRouter from 'vue-router'
import store from '@/store/index.js'
import Index from '../views/Index.vue'

Vue.use(VueRouter)

const routes = [{
  path: '/',
  component: Index,
  children: [{
      path: '',
      redirect: '/dashboard'
    },
    {
      path: '/home',
      name: 'Home',
      component: () => import("../views/Home.vue"),
      children:[{
        
          path: '/dashboard',
          name: 'Dashboard',
          component: () => import('../views/DashBoard.vue')
        },{
          path: '/goods',
          name: 'Goods',
          component: () => import('../views/Goods.vue')
        },{
          path: '/handleAdd',
          name: 'HandleAdd',
          component: () => import('../views/HandleAdd.vue')
        },
      ]
    },
  ]},
  {
    path: '/reward',
    name: 'Reward',
    component: () => import('../views/Reward.vue')
  },
  
  
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
